/*
 * @Author: 
 * @Date: 2024-08-07 11:36:41
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2024-08-09 14:14:15
 * @Description: 
 */
import {
    Body,
    Controller,
    Del,
    Get,
    Inject,
    Param,
    Put,
    Query,
    Post
} from '@midwayjs/core';
import { addGraphTypeDto, updateGraphTypeDto ,batchUpdateGraphTypeDto} from '../dto/GraphTypeDto';
import { GraphTypeService } from '../service/graphType.service';

@Controller('/graphType')
export class APIController {


    @Inject()
    graphTypeService: GraphTypeService;

    @Post('/addGraphType', { summary: '新增算法流程类型' })
    async addGraphType(@Body() params: addGraphTypeDto) {
        return await this.graphTypeService.addGraphType(params)
    }

    @Get('/getAllGraphTypes', { summary: '获取算法流程类型' })
    async getAllGraphTypes() {
        return await this.graphTypeService.getAllGraphTypes()
    }

    @Del('/deleteGraphType/:id', { summary: '删除算法流程类型' })
    async deleteGraphType(@Param('id') id: string) {
        return await this.graphTypeService.deleteGraphType(id)
    }
    @Put('/updateGraphType/:id', { summary: '更新算法流程类型' })
    async updateGraphType(@Param('id') id: string, @Body() params: updateGraphTypeDto) {
        return await this.graphTypeService.updateGraphType(id, params);
    }
    @Put('/batchAddGraphType/:id', { summary: '更新算法流程类型' })
    async batchAddGraphType(@Param('id') id: string, @Body() params: batchUpdateGraphTypeDto) {
        return await this.graphTypeService.batchAddGraphType(id, params);
    }
    @Del('/removeGraphType/:id', { summary: '移除流程类型' })
    async removeGraphType(@Param('id') id: number) {
        return await this.graphTypeService.removeGraphType(id);
    }
}





